<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../../assets/libs/jquery/jquery-3.6.1.min.js"></script>
</head>

<body>
  <script>
    const obj = {
      name: '张智琦',
      age: 18
    }
    const target = {}

    // 浅拷贝
    $.extend(target, obj)
    console.log(target)

    // 深拷贝
    $.extend(true, target, obj)
    console.log(target)
  </script>
</body>

</html>